	
	var $selectedItems = {};
	
	$(function(){
		window.widget_selected_menuItems = new widgetSelectItems('div-selected-menuitems', menuList);
		
		$(".div-menuitem").click(selectMenuItem);
	});
	
	function selectMenuItem(e){
		var id = e.srcElement.menuItemId;
		var menuItem = widget_selected_menuItems.getItem(id);
		var htmlMenuItem = [];
		htmlMenuItem.push('<div class="div-selected-menuitem"><span class="span-selected-menuitem-name">');
		htmlMenuItem.push(menuItem.name);
		htmlMenuItem.push('</span><span class="span-selected-menuitem-price">');
		htmlMenuItem.push(menuItem.price);
		htmlMenuItem.push('</span><span class="span-selected-menuitem-remove" menuItemId="');
		htmlMenuItem.push(id);
		htmlMenuItem.push('" onclick="removeMenuItem(this.menuItemId);"></span></div>');
		var item = $(htmlMenuItem.join(''));
		$selectedItems[id] = item;
		$('#div-selected-menuitems').append(item);
	}
	
	function removeMenuItem(id){
		$selectedItems[id].remove();
	}
